#任一个英文的纯文本文件，统计其中的单词出现的个数。

#def counter_word(filename):
'''
思路：使用字典
怎么创建字典？

'''    
f = open('example.txt',mode='r',encoding='utf-8')
txt = f.read().replace(',','').replace('.','')
word_lst = txt.split()
word_dict = {}
value = 1
for word in word_lst:
    if word in word_dict:
        word_dict[word] += 1
    else:
        word_dict[word] = value

print(word_dict)

    



